﻿using AutoMapper;
using J.FoodManageSet.Application.Command.TableNumCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageSet.Application.CommandHandler.TableNumCommandHandler
{
    /// <summary>
    /// 桌号删除
    /// </summary>
    public class TableNumDeleteCommandHandler : IRequestHandler<TableNumDeleteCommand, int>
    {
        private readonly ITableNumRepository _tableNumRepository;

        public TableNumDeleteCommandHandler(ITableNumRepository tableNumRepository)
        {
            _tableNumRepository = tableNumRepository;
        }
        public async Task<int> Handle(TableNumDeleteCommand request, CancellationToken cancellationToken)
        {
            var list = await _tableNumRepository.NumDelete(request.TableNumId);
            return list;
        }
    }
}
